<?PHP
if (!session_start()) { session_start(); };
/*if (!isset($_SESSION['lgnapproved'])) {
	die(header('Location: login.php'));
}*/

include("functions.php");
include("cnnxn.php");
connect();

if (isset($_GET['eid'])) {
	$error=$_GET['eid'];
	
	$SQLcr='SELECT * FROM Results WHERE EventID='.$_GET['eid'].';';
	$sendcr=mysqli_query($db,$SQLcr) or die(mysqli_error($db));
	if (!$RScr=mysqli_fetch_object($sendcr)) {
		$SQLdel='DELETE FROM Events WHERE EventID='.$_GET['eid'].';';
		//print $SQLdel;
		$sendit_del=mysqli_query($db,$SQLdel) or die(mysqli_error($db));
		$error=0;
	}
	die(header("Location: Events_viewall.php?tid=".$_GET['tid']."&er=".$error));
}
?>
